import pytest
from ..Operation.Card_Operation import Card_Operation
from ..Data.Data import Data


class Test_login(Card_Operation):
    da = Data()

    # 执行成功的测试用例
    @pytest.mark.parametrize('name,pwd,bankname,select,cardid,expect', da.readExcel('银行卡管理'))
    def test_card_1(self, name,pwd,bankname,select,cardid,expect):
        sql = f"select count(bankcard.id) from bankcard join user on bankcard.userId=user.id where user.username='{name}'"
        driver = self.driver()
        driver=self.login(name,pwd,driver)
        driver=self.addcard(bankname,select,cardid,driver)
        result=self.GetSuccessResult(sql)
        self.assertResult(result, expect)
